package com.bookstore.dao.impl;

import com.bookstore.bean.User;
import com.bookstore.dao.BaseDao;
import com.bookstore.dao.UserDao;


public class UserDaoImpl extends BaseDao<User> implements UserDao {
    @Override
    public User getUser(User user) {
        String sql="select username,accountid from userinfo where username=? and accountid=?";
        User user1 = this.query(sql, user.getUsername(), user.getAccountid());
        return user1;
    }

    @Override
    public boolean update(User user) {
        String sql="insert into userinfo(username,accountid) value(?,?)";
        int update = this.update(sql,user.getUsername(),user.getAccountid());
        return update>0;
    }
}
